<?php require_once 'header2.php';?> 
	<div class="main">
		<style>
		table{border-collapse:collapse;}
                table th{text-align:center;border:1px solid #E8EEF4; padding:2px 2px; }
                table td{border:1px solid #E8EEF4; height:32px;}
		</style>
		<h3>每日一句项目列表</h3>
		<p><a href="/index.php/admin/home/dailyone" target="mainSide">新建项目</a></p>
		<table width="100%" scroll-x=true>
			<tr>
				<th>ID</th>
				<th>拼音</th>
				<th>语句</th>
				<th>图片</th>
				<th>汉语注释</th>
				<th>英语注释</th>
				<th>操作</th>
			</tr>
			<?php 
			$f = 0;
			foreach ($query->result() as $row){
				$f++;
				$dailyone = unserialize($row->content);
				?>
					<tr>
						<td><?php echo $row->id;?></td> 
						<td><?php echo isset($dailyone['pinyin'])?$dailyone['pinyin']:'';?></td>
						<td><?php echo isset($dailyone['sentence'])?$dailyone['sentence']:'';?></td>
						<td><img src="<?php echo isset($dailyone['pic'])?$dailyone['pic']:'';?>" border="0" width="120px" height="120px" /></td>
						<td>
						<?php 
						if(isset($dailyone['explain'] )) {
							foreach( $dailyone['explain'] as $k => $one ){
									echo $k+1;
									echo '、'. $one .'<br/>';
						    }
						} ?></td>
						<td title="<?php echo $dailyone['en_explain'];?>">
						<?php echo substr($dailyone['en_explain'], 0, 35);?></td>
						<!-- <td> --><?php /*$dailyone['flag'] = isset($dailyone['flag'])?1:0;
							echo $dailyone['flag'] == 1?'已启用':'未启用';*/
							?><!-- </td> -->
						<td><a href="/index.php/admin/home/dailyone?id=<?php echo $row->id;?>">编辑</a> |  <a href="" >停用</a></td>
					</tr>
				<?php 
			}
			?>
		</table>
	</div>
<?php require_once 'footer2.php';?> 